package cn.mastor.domain;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author whale
 * @since 2022-12-12
 */
@TableName("t_discuss")
public class Discuss extends Model<Discuss> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 评论人id
     */
    @TableField("observer_id")
    private Integer observerId;
    /**
     * 评论所属
     */
    @TableField("from_id")
    private Integer fromId;
    /**
     * 评论时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date time=new Date();
    /**
     * 评论内容
     */
    private String details;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getObserverId() {
        return observerId;
    }

    public void setObserverId(Integer observerId) {
        this.observerId = observerId;
    }

    public Integer getFromId() {
        return fromId;
    }

    public void setFromId(Integer fromId) {
        this.fromId = fromId;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Discuss{" +
        ", id=" + id +
        ", observerId=" + observerId +
        ", fromId=" + fromId +
        ", time=" + time +
        ", details=" + details +
        "}";
    }
}
